<#include "../../page.ftl" />
<#assign security=JspTaglibs["/WEB-INF/security.tld"] />
<table class="table table-datatable table-gray check_table">
    <thead>
    <tr>
        <th style="width: 35px;"><input id="checkAll" type="checkbox" value=""></th>
        <th>序号</th>
        <th>代码类别ID</th>
        <th>代码信息值</th>
        <th>代码信息内容</th>
        <th>上下级联动值</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <#if codeInfoTable??>
        <#list codeInfoTable as codeInfo>
        <tr onclick="selectArowInfp(this);">
            <td><input name="infoids" type="checkbox" value="${codeInfo.id?c}"></td>
            <td>${codeInfo.sortNo!''}</td>
            <td>${codeInfo.codeTypeId!''}</td>
            <td>${codeInfo.value!''}</td>
            <td>${codeInfo.content!''}</td>
            <td>${codeInfo.parentValue!''}</td>
            <td>
                <@security.authorize ifAnyGranted="ROLE_CODE_E">
                    <a title="编辑" class="btn btn-green btn-radio nopadding"
                       onclick="return popAddOrModifyInfo(${codeInfo.id?c});"><i class="fa fa-edit"></i></a>
                </@security.authorize>
            </td>
        </tr>
        </#list>
    </#if>
    </tbody>
</table>
<#if codeInfosTable??>
    <@page table=codeInfosTable formId="search_codeInfo_table"/>
</#if>
<script>
    $(function () {
        $("#checkAll").change(function () {
            if ($(this).attr("checked")) {
                $("input[name=ids]").attr("checked", true);
            } else {
                $("input[name=ids]").attr("checked", false);
            }
        });
        $("input[name=ids]").change(function () {
            if (!$(this).attr("checked")) {
                $("#checkAll").attr("checked", false);
            }
        });
    });
</script>